package com.yingdong.logic.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;

import com.yingdong.annotation.AutoInvoke;
import com.yingdong.db.Resource;

@Service
public class ResourceService {
	private static Log logger=LogFactory.getLog(ResourceService.class);
	@AutoInvoke
	public static void init() {
		logger.info("ResourceService加载完成");
	}

	public static void onUserCreated(int userId) {
		Resource resource=new Resource();
		resource.setUserId(userId);
		resource.setItemId(1);
		resource.setResourceNum(1000);
		resource.saveToDB();
	}

}
